//
//  UINavigationController+NavPush.m
//  JXSH
//
//  Created by ebeijia.com on 2017/6/27.
//  Copyright © 2017年 李保龙. All rights reserved.
//

#import "UINavigationController+NavPush.h"

@implementation UINavigationController (NavPush)

-(void)MZL_pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    
    
    UIBarButtonItem * bar=  [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:viewController action:NULL];
    [self.viewControllers lastObject].navigationItem.backBarButtonItem=bar;
  
    if (![[self topViewController] isKindOfClass:[viewController class]]) {
        // 如果和上一个控制器一样，隔绝此操作
        [self pushViewController:viewController animated:animated];
    }else{
    
    }
    
    
}


@end
